package com.jubaopen.dao.ibatis;

import java.util.List;
import com.jubaopen.bean.ServiceFee;
import com.jubaopen.dao.ServiceFeeDAO;

public class ServiceFeeDAOImpl extends BaseIBatisDao implements ServiceFeeDAO {

	@Override
	public int add(ServiceFee serviceFee) throws Exception {
		return (Integer) this.getSqlMapClientTemplate().insert(
				"ServiceFeeMapper.insert", serviceFee);
	}

	@Override
	public ServiceFee getOneById(int id) {
		return (ServiceFee) this.getSqlMapClientTemplate().queryForObject(
				"ServiceFeeMapper.getById", id);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<ServiceFee> getListByState(int state) {
		return this.getSqlMapClientTemplate().queryForList(
				"ServiceFeeMapper.getListByState", state);
	}

	@Override
	public int update(ServiceFee serviceFee) {
		return this.getSqlMapClientTemplate().update("ServiceFeeMapper.update",
				serviceFee);
	}

}
